ceiling

 

Floor is a rounding primitive that reports the closest integer below the number, rounding down. For example, show floor 4.8 would return 4, and show floor -7.5 would return -8.

Ceiling is another rounding primitive that reports the closest integer above the number, rounding up. For example, show ceiling 5.3 would return 6, and show ceiling -4.4 would return -4.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the ceiling primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Published NetLogo models that use the ceiling primitive:
 
 
Similar primitives:
floor

Round a number down to the nearest integer.

Read more
round

reports the integer to the nearest whole number.

Read more
count

Count the number of agents in an agentset.

Read more
mean

Find the mean of a list of values.

Read more
 
Learn another primitive